package com.ruoyi.system.utils;


import org.apache.shiro.crypto.hash.Md5Hash;

/**
 * @author Cabby
 */
public abstract class PasswordUtil {

    private PasswordUtil() {
    }

    /**
     * MD5加密
     *
     * @param originalPassword 原密码
     *                         123{admin}   ->
     * @return 加密后密码
     */
    public static String encryptPassword(String username,String originalPassword, Object salt) {
        return  new Md5Hash(username + originalPassword + salt).toHex();
    }

    //测试
    public static void main(String[] args) {
        String s = PasswordUtil.encryptPassword("36125", "36125", "36125");
        System.out.println("substring = " + s);
    }
}
